import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login', // 路由重定向
  },
  {
    path: '/login',
    name: 'Login',
    component: ()=>import('@/views/Login.vue'),
    meta:{
      title:'登录'
    }
  },
  {
    path: '/home',
    name: 'home',
    component: ()=>import('@/views/Index/Index.vue'),
    meta:{
      title:'首页'
    },
  	children:[
      {
        path: '/home',
        name: 'home',
  		component: ()=>import('@/views/Home.vue'),
  		meta:{
  		  title:'首页'
  		},
      }
    ]
  },
  {
    path: '/homeSet',
    name: 'homeSet',
	meta:{
	  title:'首页配置'
	},
	component: resolve => require(['@/views/Index/Index.vue'], resolve),
    children:[
      {
        path: '/homeSet/notic',
        name: 'notic',
		component: resolve => require(['@/views/homeSet/notic.vue'], resolve),
		meta:{
		  title:'首页公告'
		}
      },
	  {
	    path: '/homeSet/noticNews',
	    name: 'noticNews',
	  		component: resolve => require(['@/views/homeSet/noticNews.vue'], resolve),
	  		meta:{
	  		  title:'通知公告'
	  		}
	  },
  	  {
  	    path: '/homeSet/swiper',
  	    name: 'swiper',
		component: ()=>import('@/views/homeSet/swiper.vue'),
		meta:{
		  title:'轮播图'
		}
  	  },
	  {
	    path: '/homeSet/goldPrice',
	    name: 'goldPrice',
	  		component: ()=>import('@/views/homeSet/goldPrice.vue'),
	  		meta:{
	  		  title:'购销价格'
	  		},
	  },
	  {
	    path: '/homeSet/goldRe',
	    name: 'goldRe',
	  		component: ()=>import('@/views/homeSet/goldRe.vue'),
	  		meta:{
	  		  title:'旧料回收'
	  		},
	  },
	  {
	    path: '/homeSet/address',
	    name: 'address',
	  		component: ()=>import('@/views/homeSet/address.vue'),
	  		meta:{
	  		  title:'地址管理'
	  		},
	  },
	  {
	    path: '/homeSet/agreement',
	    name: 'agreement',
	  		component: ()=>import('@/views/homeSet/agreement.vue'),
	  		meta:{
	  		  title:'协议管理'
	  		},
	  },
	  {
	    path: '/homeSet/payment',
	    name: 'payment',
	  		component: ()=>import('@/views/homeSet/payment.vue'),
	  		meta:{
	  		  title:'注意事项'
	  		},
	  },
	  {
	    path: '/homeSet/know',
	    name: 'know',
	  		component: ()=>import('@/views/homeSet/know.vue'),
	  		meta:{
	  		  title:'常见问题'
	  		},
	  },
	  {
	    path: '/homeSet/bookaddress',
	    name: 'bookaddress',
	  		component: ()=>import('@/views/homeSet/bookaddress.vue'),
	  		meta:{
	  		  title:'联系我们'
	  		},
	  },
	  {
	    path: '/homeSet/serDesc',
	    name: 'serDesc',
	  		component: ()=>import('@/views/homeSet/serDesc.vue'),
	  		meta:{
	  		  title:'业务说明'
	  		},
	  },
	  {
	    path: '/homeSet/annInfo',
	    name: 'annInfo',
	  		component: ()=>import('@/views/homeSet/annInfo.vue'),
	  		meta:{
	  		  title:'信息公示'
	  		},
	  },
	  {
	    path: '/homeSet/novice',
	    name: 'novice',
	  		component: ()=>import('@/views/homeSet/novice.vue'),
	  		meta:{
	  		  title:'新手引导'
	  		},
	  },
	  {
	    path: '/homeSet/textEdit',
	    name: 'novice',
	  		component: ()=>import('@/views/homeSet/textEdit.vue'),
	  		meta:{
	  		  title:'文案编辑'
	  		},
	  },
	  {
	    path: '/homeSet/config',
	    name: 'config',
	  		component: ()=>import('@/views/homeSet/config.vue'),
	  		meta:{
	  		  title:'全局配置'
	  		},
	  },
    ]
  },
  {
    path: '/buyerSys',
    name: 'buyerSys',
    component: ()=>import('@/views/Index/Index.vue'),
    meta:{
      title:'采购管理'
    },
  	children:[
      {
        path: '/buyerSys/buyerInfo',
        name: 'buyerInfo',
  		component: ()=>import('@/views/buyerSys/buyerInfo.vue'),
  		meta:{
  		  title:'采购入库'
  		},
      },
  	  {
  	    path: '/buyerSys/buyerDayData',
  	    name: 'buyerDayData',
  		component: ()=>import('@/views/buyerSys/buyerDayData.vue'),
  		meta:{
  		  title:'采购日报'
  		},
  	  },
	  {
	    path: '/buyerSys/inventoryDayData',
	    name: 'inventoryDayData',
		component: ()=>import('@/views/buyerSys/inventoryDayData.vue'),
		meta:{
		  title:'存料日报'
		},
	  },
	  {
	    path: '/buyerSys/bxList',
	    name: 'bxList',
	  		component: ()=>import('@/views/buyerSys/bxList.vue'),
	  		meta:{
	  		  title:'变现记录'
	  		},
	  },
	  {
	    path: '/buyerSys/dataQuery',
	    name: 'dataQuery',
	  		component: ()=>import('@/views/buyerSys/dataQuery.vue'),
	  		meta:{
	  		  title:'数据查询'
	  		},
	  }
    ]
  },
  {
    path: '/userSys',
    name: 'userSys',
    component: ()=>import('@/views/Index/Index.vue'),
    meta:{
      title:'用户管理'
    },
  	children:[
      {
        path: '/userSys/userList',
        name: 'userList',
  		component: ()=>import('@/views/userSys/userList.vue'),
  		meta:{
  		  title:'用户列表'
  		},
      },
	  {
	    path: '/userSys/tixianList',
	    name: 'tixianList',
		component: ()=>import('@/views/userSys/tixianList.vue'),
		meta:{
		  title:'提现列表'
		},
	  }
    ]
  },
  {
    path: '/depositSys',
    name: 'depositSys',
    component: ()=>import('@/views/Index/Index.vue'),
    meta:{
      title:'押金管理'
    },
  	children:[
      {
        path: '/depositSys/depositAccount',
        name: 'depositAccount',
  		component: ()=>import('@/views/depositSys/depositAccount.vue'),
  		meta:{
  		  title:'押金账户'
  		},
      },
	  {
	    path: '/depositSys/depositWater',
	    name: 'depositWater',
		component: ()=>import('@/views/depositSys/depositWater.vue'),
		meta:{
		  title:'押金流水'
		},
	  },
	  {
	    path: '/depositSys/handDep',
	    name: 'handDep',
	  		component: ()=>import('@/views/depositSys/handDep.vue'),
	  		meta:{
	  		  title:'交押金'
	  		},
	  },
	  {
	    path: '/depositSys/deductDep',
	    name: 'deductDep',
	  		component: ()=>import('@/views/depositSys/deductDep.vue'),
	  		meta:{
	  		  title:'扣押金'
	  		},
	  },
	  {
	    path: '/depositSys/refundDep',
	    name: 'refundDep',
	  		component: ()=>import('@/views/depositSys/refundDep.vue'),
	  		meta:{
	  		  title:'退押金'
	  		},
	  }
    ]
  },
  {
    path: '/orderSys',
    name: 'orderSys',
    component: ()=>import('@/views/Index/Index.vue'),
    meta:{
      title:'订单管理'
    },
  	children:[
      {
        path: '/orderSys/orderSell',
        name: 'orderSell',
  		component: ()=>import('@/views/orderSys/orderSell.vue'),
  		meta:{
  		  title:'回收订单'
  		},
      },
	  {
	    path: '/orderSys/orderSellPrice',
	    name: 'orderSellPrice',
		component: ()=>import('@/views/orderSys/orderSellPrice.vue'),
		meta:{
		  title:'行情订单'
		},
	  },
	  {
	    path: '/orderSys/orderSellKeep',
	    name: 'orderSellKeep',
	  		component: ()=>import('@/views/orderSys/orderSellKeep.vue'),
	  		meta:{
	  		  title:'存料订单'
	  		},
	  }
    ]
  },
]

const router = new VueRouter({
  // mode: 'history',
  routes
})

export default router
